package com._CPA_.pojo;
import io.minio.MinioClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * minio配置类
 */
@Data
@Component
@ConfigurationProperties(prefix = "min.io")
public class MinIoProperties {

    /**
     * Minio 服务端ip
     */
    private String endpoint;

    private String accessKey;

    private String secretKey;

    @Bean
    public MinioClient getMinioClient() {
        return MinioClient.builder()
                .endpoint(endpoint).credentials(accessKey, secretKey).build();
    }

}
